﻿$(function() {
	var barchart1 = echarts.init(document.getElementById('barchart1'));
    baropt1 = {
	    tooltip : {
	        trigger: 'axis',
	        axisPointer: {
		        type: 'shadow'
		    }
	    },
	    grid: {
            top: '12%',
            left: '5%',
            right: '5%',
            bottom:'14%',
            containLabel: true
        },
	    legend: {
	    	bottom:5,
	        data:['综合能耗(KWh)','实际能耗(KWh/PCS)','标杆能耗(KWh/PCS)']
	    },
	    xAxis : [{
	            type : 'category',
	            data : ['2014','2015']
	        }],
	    yAxis : [{
	            type : 'value',
	            name : 'KWh/PCS',
	            axisLabel : {
	                formatter: '{value}'
	            }
	        }, {
	            type : 'value',
	            name : 'KWh',
	            axisLabel: {
	                formatter: function (v) {
	                    return Math.round(v/10000) + ' 万'
	                }
	            }
	        }],
	    series : [{
            name:'综合能耗(KWh)',
            yAxisIndex: 1,
            type:'bar',
            data:[3247000,772470]
        },{
            name:'实际能耗(KWh/PCS)',
            type:'line',
            data:[30,23]
        },{
            name:'标杆能耗(KWh/PCS)',
            type:'line',
            data:[15,15]
        }]
	};
    barchart1.setOption(baropt1);

    var barchart2 = echarts.init(document.getElementById('barchart2'));
    baropt2 = {
        tooltip : {
	        trigger: 'axis',
	        axisPointer: {
		        type: 'shadow'
		    }
	    },
	    grid: {
            top: '12%',
            left: '5%',
            right: '5%',
            bottom:'14%',
            containLabel: true
        },
	    legend: {
	    	bottom:5,
	        data:['综合能耗(KWh)','实际能耗(KWh/PCS)','标杆能耗(KWh/PCS)']
	    },
	    xAxis : [{
	            type : 'category',
	            data : ['1','2','3','4','5','6','7','8','9','10','11','12']
	        }],
	    yAxis : [{
	            type : 'value',
	            name : 'KWh/PCS',
	            axisLabel : {
	                formatter: '{value}'
	            }
	        }, {
	            type : 'value',
	            name : 'KWh',
	            axisLabel: {
	                formatter: function (v) {
	                    return Math.round(v/10000) + ' 万'
	                }
	            }
	        }],
	    series : [{
            name:'综合能耗(KWh)',
            yAxisIndex: 1,
            type:'bar',
            data:[384700,181245,207481,187712,198371,368201,298122,203841,265412,129391,159112,310012]
        },{
            name:'实际能耗(KWh/PCS)',
            type:'line',
            data:[46,33,35,57,32,42,30,22,24,12,15,29]
        },{
            name:'标杆能耗(KWh/PCS)',
            type:'line',
            data:[18,18,18,18,18,18,18,18,18,18,18,18]
        }]
    };
    barchart2.setOption(baropt2);
    
    var barchart3 = echarts.init(document.getElementById('barchart3'));
    baropt3 = {
        tooltip : {
	        trigger: 'axis',
	        axisPointer: {
		        type: 'shadow'
		    }
	    },
	    grid: {
            top: '12%',
            left: '3%',
            right: '3%',
            bottom:'14%',
            containLabel: true
        },
	    legend: {
	    	bottom:5,
	        data:['综合能耗(KWh)','实际能耗(KWh/PCS)','标杆能耗(KWh/PCS)']
	    },
	    xAxis : [{
	            type : 'category',
	            data : ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20',
	            	'21','22','23','24','25','26','27','28','29','30','31']
	        }],
	    yAxis : [{
	            type : 'value',
	            name : 'KWh/PCS',
	            axisLabel : {
	                formatter: '{value}'
	            }
	        }, {
	            type : 'value',
	            name : 'KWh'
	        }],
	    series : [{
            name:'综合能耗(KWh)',
            yAxisIndex: 1,
            type:'bar',
            data:[32470,30125,30741,18772,19871,36801,29822,20341,26542,12931,15912,31012,
            	24700,38245,37481,22112,16419,14819,21712,29874,26412,19391,15911,31012,
            	36192,18245,20781,18772,20012,32100,17261]
        },{
            name:'实际能耗(KWh/PCS)',
            type:'line',
            data:[36,23,35,47,52,42,10,22,24,12,15,29,30,33,35,60,32,38,30,22,24,12,15,29,46,33,35,57,32,42,20]
        },{
            name:'标杆能耗(KWh/PCS)',
            type:'line',
            data:[15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]
        }]
    };
    barchart3.setOption(baropt3);
});